<template>
  <div class="ticket">
    <home-home v-if='active===1'></home-home>
    <home-mine v-if='active===2'></home-mine>
    <!-- 海选底部 -->
    <div class="bottom">
      <div class="home" @click="toHome()">
        <div class="img">
          <img :src="isHome?homeActive:home" alt />
        </div>
        <div class="txt fs-22" :class="isHome?'active':''">首页</div>
      </div>
      <div class="mine" @click="toMine()">
        <div class="img">
          <img :src="isHome?mine:mineActive" alt />
        </div>
        <div class="txt fs-22" :class="isHome?'':'active'">我的</div>
      </div>
    </div>
  </div>
</template>

<script>
import homeHome from './ticket-home'
import homeMine from './ticket-mine'
export default {
    name: "ticket",
    components:{
      homeHome,
      homeMine
    },
    data(){
        return {
            title:'门票',
            isBack:true,
            isHome: true,
            active:1,
            keyword: '',
            searchIcon:require("@/assets/index/search-gray.png"),
            cityIcon:require("@/assets/index/check-area.png"),
            rightIcon:require("@/assets/index/back-pic.png"),
            bannerImg:require("@/assets/image/music.png"),
            home: require("@/assets/public/home.png"),
            homeActive: require("@/assets/public/home-active.png"),
            mine: require("@/assets/public/mine.png"),
            mineActive: require("@/assets/public/mine-active.png"),
        }
    },
    methods: {
        changeContent() {
            // 让input搜索图片和placeholder文本内容一起消失
            if (this.keyWord != "") {
                this.isInput = true;
            }
        },
        clearContent() {
            this.keyWord = "";
        },
        toHome() {
          this.isHome = true;
          this.active=1
        },
        toMine() {
          this.isHome = false;
          this.active=2
        },
    }
}
</script>

<style scoped lang="scss">
.ticket{
  .bottom {
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    height: 0.98rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: #fff;
    .home,
    .mine {
      .img {
        width: 0.4rem;
        height: 0.4rem;
        margin: 0 auto;
        margin-bottom: 0.09rem;
        img {
          width: 100%;
        }
      }
      .txt {
        font-weight: 500;
        color: rgba(102, 102, 102, 1);
        line-height: 0.32rem;
      }
    }
    .active {
      color: #540570 !important;
    }
  }
}
</style>
